<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2017/8/21
 * Time: 22:39
 */
class UserController extends Yaf\Controller_Abstract
{

    public function indexAction(){
        //echo 'modules:User,controller:User,action:index';
        //echo 'User IndexAction';
        $params = $this->getRequest()->getParams();
        var_dump($params);
        if($this->getRequest()->isGet()){
            echo '显示模版';
        }else{
            echo '处理数据';
        }
        return true;
    }

    public function showAction()
    {
        //http://yaf_demo.com/1001/
        //userId = 1001

        //$params = $this->getRequest()->getParams();
        //var_dump($params);
        //echo $_SERVER['REQUEST_URI'];

        echo '<br/>';
        //echo 'show';
        $userId = $this->getRequest()->get('userId');
        $userModel = new UserModel();
        $data = $userModel->getUserInfo($userId);
        var_dump($data);
        return false;
    }

    public function userinfoAction()
    {
        echo 'userinfo';
        return false;
    }

}